#!/usr/bin/python
import psycopg2
print " import success "
conn = psycopg2.connect(database='logistics',host='localhost',user='postgres',password='postgres')
c=conn.cursor()
print 'get the cursor'
c.execute("select * from test_tb1")
records = c.fetchall()
import pprint
pprint.pprint(records) 
list = ['1412','4','2010-01-32 15:23:21']
str = "insert into test_tb1 values (%s,%s,to_timestamp(\'%s\',\'YYYY-MM-DD HH24:MI:SS\'));"%(list[0],list[1],list[2])
print str
c.execute(str)
conn.commit()
